package com.krause.marinechart.iso8211;


public class Leader implements Constants{
	
	protected int recLength;
	protected byte interchangeLevel;
	protected char leaderIden;
	protected byte inlineCodeExtensionIndicator;
	protected byte versionNumber;
	protected byte appIndicator;
	protected int fieldControlLength;
	protected String extendedCharSet;
	protected int fieldAreaStart;
	protected int sizeFieldLength;
	protected int sizeFieldPos;
	protected int sizeFieldTag;
	
	public Leader (byte[] mLeaderArray) {
		recLength = Integer.parseInt(new String(mLeaderArray, 0, 5));
		leaderIden = (char) mLeaderArray[6];
		fieldAreaStart = Integer.parseInt(new String(mLeaderArray, 12, 5));
		sizeFieldLength = Integer.parseInt(new String(mLeaderArray, 20, 1));
		sizeFieldPos = Integer.parseInt(new String(mLeaderArray, 21, 1));
		sizeFieldTag = Integer.parseInt(new String(mLeaderArray, 23, 1));
		
		Module.sb.append(new String(mLeaderArray + "\n\n"));
	}
		
}
